CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(gear-lib)

IF (DEFINED OS_WINDOWS)
set(CMAKE_C_FLAGS_DEBUG "/DUCRTINCLUDE=$(VCInstallDir)include ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_DEBUG "/DMSVCINCLUDE=$(VCInstallDir)include ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_DEBUG "/DWSDKINCLUDE=$(WindowsSdkDir)Include ${CMAKE_C_FLAGS_DEBUG}")
ENDIF ()

SET(POSIX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libposix/)
IF (DEFINED OS_WINDOWS)
LIST(APPEND POSIX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libposix/pthreads4w/)
LIST(APPEND POSIX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libposix/MsvcLibX/include/)
ENDIF ()

SET(DICT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libdict/)
SET(DARRAY_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libdarray/)
SET(THREAD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libthread/)
SET(GEVENT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libgevent/)
SET(MEDIA_IO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libmedia-io/)
SET(QUEUE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libqueue/)
SET(LOG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/liblog/)
SET(SOCK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libsock/)
SET(FILE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libfile/)
SET(AVCAP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libavcap/)
SET(TIME_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libtime/)

ADD_SUBDIRECTORY(libposix)
ADD_SUBDIRECTORY(libstrex)
ADD_SUBDIRECTORY(libbitmap)
ADD_SUBDIRECTORY(libdict)
ADD_SUBDIRECTORY(libdarray)
ADD_SUBDIRECTORY(libqueue)
ADD_SUBDIRECTORY(libthread)
ADD_SUBDIRECTORY(libgevent)
ADD_SUBDIRECTORY(libfile)
ADD_SUBDIRECTORY(libtime)
ADD_SUBDIRECTORY(libsock)
ADD_SUBDIRECTORY(liblog)
ADD_SUBDIRECTORY(libmedia-io)
ADD_SUBDIRECTORY(libavcap)
ADD_SUBDIRECTORY(librtmpc)
ADD_SUBDIRECTORY(librtsp)
